package com.bwie.controller;

import com.bwie.common.domain.User;
import com.bwie.common.domain.response.LoginResponse;
import com.bwie.common.result.Result;
import com.bwie.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @className: LoginController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘茂锴
 * @date: 2025/10/2 10:53
 */
@RestController
@RequestMapping("/login")
@CrossOrigin
public class LoginController {
    @Autowired
    private LoginService loginService;
    //用户名密码登录
    @PostMapping("/loginUser")
    public Result loginUser(@RequestBody User user){
        LoginResponse login=loginService.loginUser(user);
        return Result.success(login);
    }

}
